

local mt = ac.skill['塔1机制']
mt.skill_type = "passive"
mt.model1 = [[Abilities\Weapons\ZigguratFrostMissile\ZigguratFrostMissile.mdl]]

function mt:on_add()
    local hero = self.owner
    if ac.init_game==nil then
        return
    end
    hero:add_buff '预警机制'{}
    -- hero:add_restriction '无敌'
    -- hero.ui_title = ('测试10分钟后打|n%s'):format(hero.name)
    -- self:gc(ac.loop(10 * 60 * 1000,function()
    --     hero:remove_restriction '无敌'
    --     ac.player.self:send_msg('|cffff0000防御塔无敌解除！|r')
    --     ac.player.self:send_msg('|cffff0000防御塔无敌解除！|r')
    --     ac.player.self:send_msg('|cffff0000防御塔无敌解除！|r')
    --     ac.player.self:send_msg('|cffff0000防御塔无敌解除！|r')
    -- end))
    self:gc(function()
        local player = hero.owner_player
        player:set_data('刷怪速度',player:get_data('刷怪速度',0) + 4)
        player:set_data('额外刷新',player:get_data('额外刷新',0) + 5)
        if hero.name=='塔1' then
            player:set_data('塔1击杀',player:get_data('塔1击杀',0) + 1)
            if player:get_data('塔1击杀',0)==2 then
                player:set_data('阶段',1)
                local point = player:get_data('迷宫')
                player:set_camera(point,0.5)
                player:notify('引导-显示内容',player,'迷宫场景','打破迷宫后，将解锁迷宫守卫NPC，可以挑战迷宫层数，获得大量奖励！！')
            end
        end
        local point = hero:get_point()
        for a=1,5 do
            local unit = player:create_enemy(ac.enemy.elite_name,point)
            unit['木材'] = 10
        end
    end)
end


local mt = ac.skill['塔2机制']
mt.skill_type = "passive"
mt.model1 = [[Abilities\Weapons\ZigguratFrostMissile\ZigguratFrostMissile.mdl]]

function mt:on_add()
    local hero = self.owner
    if ac.init_game==nil then
        return
    end
    hero:add_buff '预警机制'{}
end


